/*---------------------------------------------------------------------------
    $Workfile		: NewAndroidProject.h $

    Author			: Joseph Chacko, Ajith Joseph
    Last $Modtime	: 16/11/2011 
    Last $Revision	: 1 $
    $History		: NewAndroidProject.h $
 ---------------------------------------------------------------------------*/
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace Microsoft::Win32;

namespace AndroidDotNET 
{
	/// <summary>
	/// Summary for NewAndroidProject
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class NewAndroidProjectForm : public System::Windows::Forms::Form
	{
		NewAndroidProjectInfo^ m_NewAndroidProjectInfo;
	public:
		CREATE_PROJECT_OPTION m_CREATE_PROJECT_OPTION ;
		NewAndroidProjectForm(NewAndroidProjectInfo^ ProjectInfo)
		{
			m_NewAndroidProjectInfo=ProjectInfo;
			InitializeComponent();
			GetNewAndroidProjectInfo();
			//
			//TODO: Add the constructor code here
			//
		}
	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~NewAndroidProjectForm()
		{
			if (components)
			{
				delete components;
			}
		}

	private: System::Windows::Forms::Button^  buttonFinish;
	private: System::Windows::Forms::Button^  buttonCancel;
	private: System::Windows::Forms::TabControl^  tabControl1;
	private: System::Windows::Forms::TabPage^  tabPageProject;
	private: System::Windows::Forms::TextBox^  textBoxProjectName;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::GroupBox^  groupBox1;
	private: System::Windows::Forms::RadioButton^  radioButtonExistingSample;


	private: System::Windows::Forms::Button^  buttonBrowse;
	private: System::Windows::Forms::TextBox^  textBoxLocation;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::RadioButton^  radioButtonNewProject;


	private: System::Windows::Forms::TabPage^  tabPageBuild;
	private: System::Windows::Forms::GroupBox^  groupBox2;
	private: System::Windows::Forms::ListView^  listViewTarget;

	private: System::Windows::Forms::ColumnHeader^  columnHeader1;

	private: System::Windows::Forms::ColumnHeader^  columnHeader3;
	private: System::Windows::Forms::ColumnHeader^  columnHeader4;
	private: System::Windows::Forms::TabPage^  tabPageProperties;

	private: System::Windows::Forms::ListView^  listView1;
	private: System::Windows::Forms::ColumnHeader^  columnTarget;
	private: System::Windows::Forms::ColumnHeader^  columnVendors;
	private: System::Windows::Forms::ColumnHeader^  columnHeaderAPI;
	private: System::Windows::Forms::ColumnHeader^  columnHeaderApplication;
	private: System::Windows::Forms::GroupBox^  groupBox3;
	private: System::Windows::Forms::TextBox^  textBoxMinSDKVersion;
	private: System::Windows::Forms::Label^  label5;

	private: System::Windows::Forms::TextBox^  textBoxPackageName;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::TextBox^  textBoxActivityName;

	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::Label^  label6;
	private: System::Windows::Forms::ComboBox^  comboBoxSamples;

	private: System::Windows::Forms::Button^  buttonInfo;
	private: System::Windows::Forms::Label^  label7;
	private: System::Windows::Forms::Label^  labelPlatformVersion;

protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->buttonFinish = (gcnew System::Windows::Forms::Button());
			this->buttonCancel = (gcnew System::Windows::Forms::Button());
			this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
			this->tabPageProject = (gcnew System::Windows::Forms::TabPage());
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
			this->labelPlatformVersion = (gcnew System::Windows::Forms::Label());
			this->textBoxProjectName = (gcnew System::Windows::Forms::TextBox());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->buttonInfo = (gcnew System::Windows::Forms::Button());
			this->label7 = (gcnew System::Windows::Forms::Label());
			this->label6 = (gcnew System::Windows::Forms::Label());
			this->comboBoxSamples = (gcnew System::Windows::Forms::ComboBox());
			this->radioButtonExistingSample = (gcnew System::Windows::Forms::RadioButton());
			this->buttonBrowse = (gcnew System::Windows::Forms::Button());
			this->textBoxLocation = (gcnew System::Windows::Forms::TextBox());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->radioButtonNewProject = (gcnew System::Windows::Forms::RadioButton());
			this->tabPageBuild = (gcnew System::Windows::Forms::TabPage());
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
			this->listViewTarget = (gcnew System::Windows::Forms::ListView());
			this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
			this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());
			this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
			this->tabPageProperties = (gcnew System::Windows::Forms::TabPage());
			this->groupBox3 = (gcnew System::Windows::Forms::GroupBox());
			this->textBoxMinSDKVersion = (gcnew System::Windows::Forms::TextBox());
			this->label5 = (gcnew System::Windows::Forms::Label());
			this->textBoxPackageName = (gcnew System::Windows::Forms::TextBox());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->textBoxActivityName = (gcnew System::Windows::Forms::TextBox());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->listView1 = (gcnew System::Windows::Forms::ListView());
			this->columnTarget = (gcnew System::Windows::Forms::ColumnHeader());
			this->columnVendors = (gcnew System::Windows::Forms::ColumnHeader());
			this->columnHeaderAPI = (gcnew System::Windows::Forms::ColumnHeader());
			this->columnHeaderApplication = (gcnew System::Windows::Forms::ColumnHeader());
			this->tabControl1->SuspendLayout();
			this->tabPageProject->SuspendLayout();
			this->groupBox1->SuspendLayout();
			this->tabPageBuild->SuspendLayout();
			this->groupBox2->SuspendLayout();
			this->tabPageProperties->SuspendLayout();
			this->groupBox3->SuspendLayout();
			this->SuspendLayout();
			// 
			// buttonFinish
			// 
			this->buttonFinish->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->buttonFinish->Location = System::Drawing::Point(284, 319);
			this->buttonFinish->Name = L"buttonFinish";
			this->buttonFinish->Size = System::Drawing::Size(75, 23);
			this->buttonFinish->TabIndex = 9;
			this->buttonFinish->Text = L"OK";
			this->buttonFinish->UseVisualStyleBackColor = true;
			this->buttonFinish->Click += gcnew System::EventHandler(this, &NewAndroidProjectForm::buttonFinish_Click);
			// 
			// buttonCancel
			// 
			this->buttonCancel->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->buttonCancel->Location = System::Drawing::Point(365, 319);
			this->buttonCancel->Name = L"buttonCancel";
			this->buttonCancel->Size = System::Drawing::Size(75, 23);
			this->buttonCancel->TabIndex = 10;
			this->buttonCancel->Text = L"Cancel";
			this->buttonCancel->UseVisualStyleBackColor = true;
			this->buttonCancel->Click += gcnew System::EventHandler(this, &NewAndroidProjectForm::buttonCancel_Click);
			// 
			// tabControl1
			// 
			this->tabControl1->Controls->Add(this->tabPageProject);
			this->tabControl1->Controls->Add(this->tabPageBuild);
			this->tabControl1->Controls->Add(this->tabPageProperties);
			this->tabControl1->Location = System::Drawing::Point(10, 14);
			this->tabControl1->Name = L"tabControl1";
			this->tabControl1->SelectedIndex = 0;
			this->tabControl1->Size = System::Drawing::Size(430, 295);
			this->tabControl1->TabIndex = 0;
			// 
			// tabPageProject
			// 
			this->tabPageProject->Controls->Add(this->groupBox1);
			this->tabPageProject->Location = System::Drawing::Point(4, 22);
			this->tabPageProject->Name = L"tabPageProject";
			this->tabPageProject->Padding = System::Windows::Forms::Padding(3);
			this->tabPageProject->Size = System::Drawing::Size(422, 269);
			this->tabPageProject->TabIndex = 0;
			this->tabPageProject->Text = L"Project Info";
			this->tabPageProject->UseVisualStyleBackColor = true;
			this->tabPageProject->Click += gcnew System::EventHandler(this, &NewAndroidProjectForm::tabPageProject_Click);
			// 
			// groupBox1
			// 
			this->groupBox1->Controls->Add(this->labelPlatformVersion);
			this->groupBox1->Controls->Add(this->textBoxProjectName);
			this->groupBox1->Controls->Add(this->label1);
			this->groupBox1->Controls->Add(this->buttonInfo);
			this->groupBox1->Controls->Add(this->label7);
			this->groupBox1->Controls->Add(this->label6);
			this->groupBox1->Controls->Add(this->comboBoxSamples);
			this->groupBox1->Controls->Add(this->radioButtonExistingSample);
			this->groupBox1->Controls->Add(this->buttonBrowse);
			this->groupBox1->Controls->Add(this->textBoxLocation);
			this->groupBox1->Controls->Add(this->label2);
			this->groupBox1->Controls->Add(this->radioButtonNewProject);
			this->groupBox1->Location = System::Drawing::Point(-1, 7);
			this->groupBox1->Name = L"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(419, 269);
			this->groupBox1->TabIndex = 3;
			this->groupBox1->TabStop = false;
			this->groupBox1->Text = L"Contents";
			this->groupBox1->Enter += gcnew System::EventHandler(this, &NewAndroidProjectForm::groupBox1_Enter_1);
			// 
			// labelPlatformVersion
			// 
			this->labelPlatformVersion->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->labelPlatformVersion->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->labelPlatformVersion->Location = System::Drawing::Point(172, 143);
			this->labelPlatformVersion->Name = L"labelPlatformVersion";
			this->labelPlatformVersion->Size = System::Drawing::Size(160, 18);
			this->labelPlatformVersion->TabIndex = 4;
			// 
			// textBoxProjectName
			// 
			this->textBoxProjectName->Location = System::Drawing::Point(125, 36);
			this->textBoxProjectName->Name = L"textBoxProjectName";
			this->textBoxProjectName->Size = System::Drawing::Size(275, 20);
			this->textBoxProjectName->TabIndex = 1;
			this->textBoxProjectName->TextChanged += gcnew System::EventHandler(this, &NewAndroidProjectForm::textBoxProjectName_TextChanged);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label1->Location = System::Drawing::Point(20, 36);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(71, 13);
			this->label1->TabIndex = 4;
			this->label1->Text = L"Project Name";
			this->label1->Click += gcnew System::EventHandler(this, &NewAndroidProjectForm::label1_Click);
			// 
			// buttonInfo
			// 
			this->buttonInfo->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->buttonInfo->Location = System::Drawing::Point(338, 139);
			this->buttonInfo->Name = L"buttonInfo";
			this->buttonInfo->Size = System::Drawing::Size(62, 23);
			this->buttonInfo->TabIndex = 5;
			this->buttonInfo->Text = L"Info";
			this->buttonInfo->UseVisualStyleBackColor = true;
			this->buttonInfo->Click += gcnew System::EventHandler(this, &NewAndroidProjectForm::buttonInfo_Click);
			// 
			// label7
			// 
			this->label7->AutoSize = true;
			this->label7->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label7->Location = System::Drawing::Point(20, 143);
			this->label7->Name = L"label7";
			this->label7->Size = System::Drawing::Size(146, 13);
			this->label7->TabIndex = 16;
			this->label7->Text = L"Existing Build target Version  :";
			// 
			// label6
			// 
			this->label6->AutoSize = true;
			this->label6->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label6->Location = System::Drawing::Point(20, 182);
			this->label6->Name = L"label6";
			this->label6->Size = System::Drawing::Size(42, 13);
			this->label6->TabIndex = 8;
			this->label6->Text = L"Sample";
			// 
			// comboBoxSamples
			// 
			this->comboBoxSamples->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBoxSamples->Enabled = false;
			this->comboBoxSamples->FormattingEnabled = true;
			this->comboBoxSamples->Location = System::Drawing::Point(82, 182);
			this->comboBoxSamples->Name = L"comboBoxSamples";
			this->comboBoxSamples->Size = System::Drawing::Size(318, 21);
			this->comboBoxSamples->TabIndex = 6;
			this->comboBoxSamples->SelectedIndexChanged += gcnew System::EventHandler(this, &NewAndroidProjectForm::comboBoxSamples_SelectedIndexChanged);
			// 
			// radioButtonExistingSample
			// 
			this->radioButtonExistingSample->AutoSize = true;
			this->radioButtonExistingSample->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->radioButtonExistingSample->Location = System::Drawing::Point(20, 104);
			this->radioButtonExistingSample->Name = L"radioButtonExistingSample";
			this->radioButtonExistingSample->Size = System::Drawing::Size(219, 17);
			this->radioButtonExistingSample->TabIndex = 3;
			this->radioButtonExistingSample->Text = L"Create New Project From Existing Source";
			this->radioButtonExistingSample->UseVisualStyleBackColor = true;
			this->radioButtonExistingSample->CheckedChanged += gcnew System::EventHandler(this, &NewAndroidProjectForm::radioButtonExistingSample_CheckedChanged);
			// 
			// buttonBrowse
			// 
			this->buttonBrowse->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->buttonBrowse->Location = System::Drawing::Point(338, 226);
			this->buttonBrowse->Name = L"buttonBrowse";
			this->buttonBrowse->Size = System::Drawing::Size(62, 23);
			this->buttonBrowse->TabIndex = 8;
			this->buttonBrowse->Text = L"Browse";
			this->buttonBrowse->UseVisualStyleBackColor = true;
			this->buttonBrowse->Click += gcnew System::EventHandler(this, &NewAndroidProjectForm::buttonBrowse_Click);
			// 
			// textBoxLocation
			// 
			this->textBoxLocation->Location = System::Drawing::Point(73, 226);
			this->textBoxLocation->Name = L"textBoxLocation";
			this->textBoxLocation->Size = System::Drawing::Size(259, 20);
			this->textBoxLocation->TabIndex = 7;
			this->textBoxLocation->TextChanged += gcnew System::EventHandler(this, &NewAndroidProjectForm::textBoxLocation_TextChanged);
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label2->Location = System::Drawing::Point(20, 226);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(48, 13);
			this->label2->TabIndex = 3;
			this->label2->Text = L"Location";
			// 
			// radioButtonNewProject
			// 
			this->radioButtonNewProject->AutoSize = true;
			this->radioButtonNewProject->Checked = true;
			this->radioButtonNewProject->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->radioButtonNewProject->Location = System::Drawing::Point(20, 68);
			this->radioButtonNewProject->Name = L"radioButtonNewProject";
			this->radioButtonNewProject->Size = System::Drawing::Size(186, 17);
			this->radioButtonNewProject->TabIndex = 2;
			this->radioButtonNewProject->TabStop = true;
			this->radioButtonNewProject->Text = L"Create New Project in Workspace";
			this->radioButtonNewProject->UseVisualStyleBackColor = true;
			this->radioButtonNewProject->CheckedChanged += gcnew System::EventHandler(this, &NewAndroidProjectForm::radioButtonNewProject_CheckedChanged);
			// 
			// tabPageBuild
			// 
			this->tabPageBuild->Controls->Add(this->groupBox2);
			this->tabPageBuild->Location = System::Drawing::Point(4, 22);
			this->tabPageBuild->Name = L"tabPageBuild";
			this->tabPageBuild->Padding = System::Windows::Forms::Padding(3);
			this->tabPageBuild->Size = System::Drawing::Size(422, 269);
			this->tabPageBuild->TabIndex = 1;
			this->tabPageBuild->Text = L"Build Target Info";
			this->tabPageBuild->UseVisualStyleBackColor = true;
			// 
			// groupBox2
			// 
			this->groupBox2->Controls->Add(this->listViewTarget);
			this->groupBox2->Location = System::Drawing::Point(7, 12);
			this->groupBox2->Name = L"groupBox2";
			this->groupBox2->Size = System::Drawing::Size(407, 251);
			this->groupBox2->TabIndex = 4;
			this->groupBox2->TabStop = false;
			this->groupBox2->Text = L"Build Target";
			// 
			// listViewTarget
			// 
			this->listViewTarget->CheckBoxes = true;
			this->listViewTarget->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(3) {this->columnHeader1, 
				this->columnHeader3, this->columnHeader4});
			this->listViewTarget->Dock = System::Windows::Forms::DockStyle::Fill;
			this->listViewTarget->Location = System::Drawing::Point(3, 16);
			this->listViewTarget->Name = L"listViewTarget";
			this->listViewTarget->Size = System::Drawing::Size(401, 232);
			this->listViewTarget->TabIndex = 0;
			this->listViewTarget->UseCompatibleStateImageBehavior = false;
			this->listViewTarget->View = System::Windows::Forms::View::Details;
			this->listViewTarget->ItemChecked += gcnew System::Windows::Forms::ItemCheckedEventHandler(this, &NewAndroidProjectForm::listViewTarget_ItemChecked);
			this->listViewTarget->SelectedIndexChanged += gcnew System::EventHandler(this, &NewAndroidProjectForm::listViewTarget_SelectedIndexChanged);
			// 
			// columnHeader1
			// 
			this->columnHeader1->Text = L"Target";
			this->columnHeader1->Width = 143;
			// 
			// columnHeader3
			// 
			this->columnHeader3->Text = L"Platform";
			this->columnHeader3->Width = 113;
			// 
			// columnHeader4
			// 
			this->columnHeader4->Text = L"API Level";
			this->columnHeader4->Width = 107;
			// 
			// tabPageProperties
			// 
			this->tabPageProperties->Controls->Add(this->groupBox3);
			this->tabPageProperties->Location = System::Drawing::Point(4, 22);
			this->tabPageProperties->Name = L"tabPageProperties";
			this->tabPageProperties->Size = System::Drawing::Size(422, 269);
			this->tabPageProperties->TabIndex = 2;
			this->tabPageProperties->Text = L"Project Properties";
			this->tabPageProperties->UseVisualStyleBackColor = true;
			// 
			// groupBox3
			// 
			this->groupBox3->Controls->Add(this->textBoxMinSDKVersion);
			this->groupBox3->Controls->Add(this->label5);
			this->groupBox3->Controls->Add(this->textBoxPackageName);
			this->groupBox3->Controls->Add(this->label4);
			this->groupBox3->Controls->Add(this->textBoxActivityName);
			this->groupBox3->Controls->Add(this->label3);
			this->groupBox3->Location = System::Drawing::Point(-2, 28);
			this->groupBox3->Name = L"groupBox3";
			this->groupBox3->Size = System::Drawing::Size(420, 244);
			this->groupBox3->TabIndex = 6;
			this->groupBox3->TabStop = false;
			this->groupBox3->Text = L"Properties";
			// 
			// textBoxMinSDKVersion
			// 
			this->textBoxMinSDKVersion->Location = System::Drawing::Point(153, 179);
			this->textBoxMinSDKVersion->Name = L"textBoxMinSDKVersion";
			this->textBoxMinSDKVersion->Size = System::Drawing::Size(230, 20);
			this->textBoxMinSDKVersion->TabIndex = 6;
			// 
			// label5
			// 
			this->label5->AutoSize = true;
			this->label5->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label5->Location = System::Drawing::Point(28, 179);
			this->label5->Name = L"label5";
			this->label5->Size = System::Drawing::Size(87, 13);
			this->label5->TabIndex = 5;
			this->label5->Text = L"Min SDK Version";
			// 
			// textBoxPackageName
			// 
			this->textBoxPackageName->Location = System::Drawing::Point(153, 118);
			this->textBoxPackageName->Name = L"textBoxPackageName";
			this->textBoxPackageName->Size = System::Drawing::Size(230, 20);
			this->textBoxPackageName->TabIndex = 3;
			// 
			// label4
			// 
			this->label4->AutoSize = true;
			this->label4->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label4->Location = System::Drawing::Point(28, 118);
			this->label4->Name = L"label4";
			this->label4->Size = System::Drawing::Size(81, 13);
			this->label4->TabIndex = 2;
			this->label4->Text = L"Package Name";
			// 
			// textBoxActivityName
			// 
			this->textBoxActivityName->Location = System::Drawing::Point(153, 65);
			this->textBoxActivityName->Name = L"textBoxActivityName";
			this->textBoxActivityName->Size = System::Drawing::Size(230, 20);
			this->textBoxActivityName->TabIndex = 1;
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->label3->Location = System::Drawing::Point(28, 65);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(72, 13);
			this->label3->TabIndex = 0;
			this->label3->Text = L"Activity Name";
			// 
			// listView1
			// 
			this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(4) {this->columnTarget, this->columnVendors, 
				this->columnHeaderAPI, this->columnHeaderApplication});
			this->listView1->Location = System::Drawing::Point(7, 26);
			this->listView1->Name = L"listView1";
			this->listView1->Size = System::Drawing::Size(351, 145);
			this->listView1->TabIndex = 0;
			this->listView1->UseCompatibleStateImageBehavior = false;
			this->listView1->View = System::Windows::Forms::View::Details;
			// 
			// columnTarget
			// 
			this->columnTarget->Text = L"Target";
			this->columnTarget->Width = 65;
			// 
			// columnVendors
			// 
			this->columnVendors->Text = L"Vendors";
			this->columnVendors->Width = 87;
			// 
			// columnHeaderAPI
			// 
			this->columnHeaderAPI->Text = L"API";
			this->columnHeaderAPI->Width = 113;
			// 
			// columnHeaderApplication
			// 
			this->columnHeaderApplication->Text = L"Application";
			this->columnHeaderApplication->Width = 107;
			// 
			// NewAndroidProjectForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(451, 351);
			this->Controls->Add(this->tabControl1);
			this->Controls->Add(this->buttonCancel);
			this->Controls->Add(this->buttonFinish);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
			this->MaximizeBox = false;
			this->MinimizeBox = false;
			this->Name = L"NewAndroidProjectForm";
			this->ShowInTaskbar = false;
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = L"New Android Project ";
			this->Load += gcnew System::EventHandler(this, &NewAndroidProjectForm::NewAndroidProjectForm_Load);
			this->tabControl1->ResumeLayout(false);
			this->tabPageProject->ResumeLayout(false);
			this->groupBox1->ResumeLayout(false);
			this->groupBox1->PerformLayout();
			this->tabPageBuild->ResumeLayout(false);
			this->groupBox2->ResumeLayout(false);
			this->tabPageProperties->ResumeLayout(false);
			this->groupBox3->ResumeLayout(false);
			this->groupBox3->PerformLayout();
			this->ResumeLayout(false);

		}
#pragma endregion
private: System::Void NewAndroidProjectForm_Load(System::Object^  sender, System::EventArgs^  e)
		 {	 
			 //Loading previous location from Registry
			 textBoxLocation->Text=LoadLocationFromRegistry();

			 //Loading previous target from Registry
			 System::String^ reg_strTargetName=LoadTargetFromRegistry();

			 
			 listView1->Clear();
			 for(int i=0;i<m_NewAndroidProjectInfo->m_NewAndroidTSArray->Count;i++)
			 {
				 ListViewItem^ Item=listViewTarget->Items->Add(m_NewAndroidProjectInfo->m_NewAndroidTSArray[i]->m_strTargetName);
				 //Item->SubItems->Add(m_NewAndroidProjectInfo->m_NewAndroidTSArray[i]->m_strTargetName);
				 Item->SubItems->Add(m_NewAndroidProjectInfo->m_NewAndroidTSArray[i]->m_strPlatform);
				 Item->SubItems->Add(m_NewAndroidProjectInfo->m_NewAndroidTSArray[i]->m_strAPI);
				 if(reg_strTargetName==m_NewAndroidProjectInfo->m_NewAndroidTSArray[i]->m_strFolderName)
				 {
					 Item->Checked=true;
				 }
			 }
			 
			 tabControl1->SelectedIndex=1;
			 tabControl1->SelectedIndex=0;
			 textBoxProjectName->Focus();
		 }
private: System::Void radioButton3_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 }
private: System::Void vScrollBar1_Scroll(System::Object^  sender, System::Windows::Forms::ScrollEventArgs^  e) {
		 }
private: System::Void groupBox1_Enter(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void groupBox3_Enter(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void groupBox3_Enter_1(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void buttonCancel_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 this->Close();
		 }
private: System::Void buttonFinish_Click(System::Object^  sender, System::EventArgs^  e)
		 {
			 CAndroidDotNetSettings^ m_AndroidDotNetSettings=gcnew CAndroidDotNetSettings();
			 CAndroidDotNetManager^ manager=gcnew CAndroidDotNetManager();
			 if(radioButtonExistingSample->Checked==true)
			 {
				 m_CREATE_PROJECT_OPTION=CREATE_PROJECT_FROM_EXISTING_SOURCE;

				 m_NewAndroidProjectInfo=(NewAndroidProjectInfo^)comboBoxSamples->Items[comboBoxSamples->SelectedIndex];
				 
				 m_NewAndroidProjectInfo->m_bCopySrcFromExistingSample=true;
				 if(textBoxLocation->Text=="")
				 {
					 MessageBox::Show("Please Select the Location");
				 }
				 if(textBoxLocation->Text!="")
				 {
					 m_NewAndroidProjectInfo->m_strExistingLocation=textBoxLocation->Text;
					 if(m_NewAndroidProjectInfo->m_bCopySrcFromExistingSample==true)
					 { 
						 DialogResult=System::Windows::Forms::DialogResult::OK;
						 this->Close();
					 }
				 }
			 }
			 else if(textBoxProjectName->Text=="")
			 {
				 tabControl1->SelectedIndex=0;
				 System::Windows::Forms::MessageBox::Show("Enter Project Name","Error");
				 textBoxProjectName->Focus();
			 }
			  else if(textBoxLocation->Text=="")
			 {
				 System::Windows::Forms::MessageBox::Show("Invalide Location","Error");
				 textBoxLocation->Focus();
			 }
			 else
			 {
				 m_CREATE_PROJECT_OPTION=CREATE_NEW_PROJECT;

				 m_NewAndroidProjectInfo->m_strProjectName=textBoxProjectName->Text;
				 m_NewAndroidProjectInfo->m_strActivityName=textBoxActivityName->Text;
				 m_NewAndroidProjectInfo->m_strPackageName=textBoxPackageName->Text;
				 
				 if(textBoxLocation->Text!="")
				 {
					 
					 m_NewAndroidProjectInfo->m_strLocation=textBoxLocation->Text;
				 }

				 //receive the select platform and other info
				 if(listViewTarget->SelectedItems->Count>0)
				 {
					 int iSelectedIndex=listViewTarget->SelectedIndices[0];
					 m_NewAndroidProjectInfo->m_SelectedTargetSettings=m_NewAndroidProjectInfo->m_NewAndroidTSArray[iSelectedIndex];
				 }
				 this->Close();
				 DialogResult=System::Windows::Forms::DialogResult::OK;
			 }
                     		 }

public: NewAndroidProjectInfo^ GetNewAndroidProjectInfo()
		 {
			 try
			 {
				 return m_NewAndroidProjectInfo;
			 }
			 catch(...)
			 {
				 return m_NewAndroidProjectInfo;
			 }
		}
private: System::Void textBoxMinSDKVersion_TextChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
public:

private: System::Void buttonBrowse_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 FolderBrowserDialog ^ objFolderBrowserDialog = gcnew FolderBrowserDialog();
			 objFolderBrowserDialog->ShowDialog();
			 System::String^ BrowseLocation=objFolderBrowserDialog->SelectedPath;
			 if (BrowseLocation !="")
			 {
				 textBoxLocation->Text=BrowseLocation;
			 }
		 }
private: System::Void tabPageProject_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void listViewTarget_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void listViewTarget_ItemChecked(System::Object^  sender, System::Windows::Forms::ItemCheckedEventArgs^  e)
		 {
			 if(e->Item->Checked)
			 {
				 int iChekedIndex=e->Item->Index;
				 for(int i=0;i<listViewTarget->Items->Count;i++)
				 {
					 if(iChekedIndex!=i)
					 {
						listViewTarget->Items[i]->Checked=false;
					 }
				 }
				 LoadSamples(iChekedIndex);
			 }
		 }
private: System::Void comboBoxSamples_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
			
		 }
 private: System::Void LoadSamples(int iTargetIndex)
		  {
			  CAndroidDotNetSettings^ Settings=gcnew CAndroidDotNetSettings();
			  textBoxMinSDKVersion->Text=m_NewAndroidProjectInfo->m_NewAndroidTSArray[ iTargetIndex]->m_strAPI;
			  labelPlatformVersion->Text=m_NewAndroidProjectInfo->m_NewAndroidTSArray[ iTargetIndex]->m_strFolderName;

			  //save target to registry
			  SaveTargetToRegistry(m_NewAndroidProjectInfo->m_NewAndroidTSArray[ iTargetIndex]->m_strFolderName);
			  array<System::String^>^ Subdirs=Directory::GetDirectories(Settings->m_strSDKLocation+"platforms");
			  System::String^ PltformDir=Subdirs[iTargetIndex];
			  System::String^ PlatformDirectyName="";
			  
			  array<Char>^Folderchars = {'\\'};
			  array<String^>^ FolderTokens =PltformDir->Split(Folderchars);
			  
			  //Getting the platform directory name
			  PlatformDirectyName=FolderTokens[FolderTokens->Length-1];

			  //array<System::String^>^ SampleSubdirs=Directory::GetDirectories(m_NewAndroidProjectInfo->location+"\\"+"samples");
			  array<System::String^>^ SampleSubdirs=Directory::GetDirectories(Settings->m_strSDKLocation+"\\"+"samples");
			  int SampleDirectoryIndex=-1;

			  for(int i=0;i<SampleSubdirs->Length;i++)
			  {
				  array<Char>^Folderchars = {'\\'};
				  array<String^>^ FolderTokens =SampleSubdirs[i]->Split(Folderchars);
				  if(FolderTokens[FolderTokens->Length-1]==PlatformDirectyName)
				  {
					  SampleDirectoryIndex=i;
				  }
			  }
			  System::String^ SampleDirectory="";
			  if(SampleDirectoryIndex!=-1)
			  {
				  SampleDirectory=SampleSubdirs[SampleDirectoryIndex];
			  }
			  if(SampleDirectory!="")
			  {
				  comboBoxSamples->Items->Clear();
				  array<System::String^>^ SampleFolders=Directory::GetDirectories(SampleDirectory);
				  for(int j=0;j<SampleFolders->Length;j++)
				  {
					  array<Char>^Folderchars = {'\\'};
					  array<String^>^ FolderTokens =SampleFolders[j]->Split(Folderchars);
					  NewAndroidProjectInfo^ Item=gcnew NewAndroidProjectInfo();
					  Item->m_strValue=SampleFolders[j];
					  Item->m_strName= FolderTokens[FolderTokens->Length-1];
					  comboBoxSamples->Items->Add(Item);
				  }
			  }
		  }

private: System::Void buttonInfo_Click(System::Object^  sender, System::EventArgs^  e)
		 {
			 tabControl1->SelectedIndex=1;
		 }
private: System::Void textBoxProjectName_TextChanged(System::Object^  sender, System::EventArgs^  e) 
		 {
			 textBoxActivityName->Text=textBoxProjectName->Text+"Activity";
			 textBoxPackageName->Text="com."+textBoxProjectName->Text;
		 }
private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void textBoxLocation_TextChanged(System::Object^  sender, System::EventArgs^  e) 
		 {
			 SaveLocationToRegistry(textBoxLocation->Text);
		 }
private: System::Void groupBox1_Enter_1(System::Object^  sender, System::EventArgs^  e) {
		 }
//save location to registry		 
private: System::Boolean SaveLocationToRegistry(System::String^ strLocation)
        {
			try
			{
				RegistryKey^ key = Registry::CurrentUser->CreateSubKey("Software\\Tek-Tips.Info\\Android\\");
				key->SetValue("DEFAULT_PROJECT_LOCATION", strLocation);
				key->Close();
				return true;
			}
			catch (...)
			{
				return false;
			}
        }
//Retrive previous location from registry
private: System::String^ LoadLocationFromRegistry()
		 {
			 try
			 {
				 System::String^ strLocation;
				 RegistryKey^ key = Registry::CurrentUser->CreateSubKey("Software\\Tek-Tips.Info\\Android\\");
				 strLocation= key->GetValue("DEFAULT_PROJECT_LOCATION")->ToString();
				 key->Close();
				 return strLocation;
			 }
			 catch (...)
			 {
				 return "";
			 }
		 }


//save target to registry		 
private: System::Boolean SaveTargetToRegistry(System::String^ strTarget)
        {
            try
            {
				RegistryKey^ key = Registry::CurrentUser->CreateSubKey("Software\\Tek-Tips.Info\\Android\\");
				key->SetValue("DEFAULT_TARGET_VERSION", strTarget);
				key->Close();
				return true;
			}
            catch (...)
            {
                return false;
            }
        }

//retrive previous target from restry		 		 
private: System::String^ LoadTargetFromRegistry()
		 {
			 try
			 {
				 System::String^ strTarget;
				 RegistryKey^ key = Registry::CurrentUser->CreateSubKey("Software\\Tek-Tips.Info\\Android\\");
				 strTarget= key->GetValue("DEFAULT_TARGET_VERSION")->ToString();
				 key->Close();
				 return strTarget;
			 }
			 catch (...)
			 {
				 return "";
			 }
		 }

//Retrive previous SDK location from registry
private: System::String^ LoadSDKLocationFromRegistry()
		 {
			 try
			 {
				 System::String^ strSDKLocation;
				 RegistryKey^ key = Registry::CurrentUser->CreateSubKey("Software\\Tek-Tips.Info\\Android\\");
				 strSDKLocation= key->GetValue("DEFAULT_SDK_LOCATION")->ToString();
				 key->Close();
				 return strSDKLocation;
			 }
			 catch (...)
			 {
				 return "";
			 }
		 }

private: System::Void radioButtonNewProject_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			   if(radioButtonNewProject->Checked==true)
			   {
				   textBoxProjectName->Enabled=true;
				   comboBoxSamples->Enabled=false;
			   }
		 }
private: System::Void radioButtonExistingSample_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
		 {
			    if(radioButtonExistingSample->Checked==true)
				{
					textBoxProjectName->Enabled=false;
					comboBoxSamples->Enabled=true;
				}
		 }
};
}
